﻿<?php if(($sf_user->hasCredential("responsable")) || ($sf_user->hasCredential("livreur")) || ($sf_user->hasCredential("magasinier"))){?>
<div class="login">
<form action="/recherche/search" method="post">
	<table width="100%" style="border: 1px solid #FFFFFF; border-collapse: separate; border-spacing: 5px;">
		<tr>
			<td colspan="2" style="background-color: white; color: #77766F; text-align: center; font-weight: bold;">
				Recherche
			</td>
		</tr>
		<tr>
			<td style="margin-left: 10px">Nom du produit:</td>
			<td style="width: 70%"><input type="text" name="nom_produit" /></td>
		</tr>
		<tr>
			<td style="width: 30%">en stock:</td>
			<td style="width: 70%"><SELECT name="stock">
																		<OPTION VALUE="Indifferent">Indifférent</OPTION>
																		<OPTION VALUE="Oui">Oui</OPTION>
																		<OPTION VALUE="Non">Non</OPTION>
														</SELECT>
			</td>
		</tr>
		<tr>
			<td style="width: 30%">Vendu au client</td>
			<td style="width: 70%"><SELECT name="client">
			<?php foreach ($utilisateurs as $key => $utilisateur):
	    	if($key % 2 == 0) {
	    		$style = "background-color: #A9CADD";
	    	} else {
	    		$style = "background-color: #E6F7FE";
	    	}   
			?>
			<OPTION VALUE="<?php echo $utilisateur->getId(); ?>"><?php echo $utilisateur->getNom()." ".$utilisateur->getPrenom(); ?></OPTION>
    <?php endforeach; ?>
			<OPTION SELECTED VALUE="-1">Indifférent</OPTION>
			</SELECT>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center"><input type="submit"
				name="button" value="Lancer la recherche" /></td>
		</tr>
	</table>
</form>
</div>
<?php	}else{
	echo "Droits insuffisants.";
} ?>